package com.etc.service;

import com.etc.entity.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

@Component
@FeignClient(value = "cloud-nacos-insert")
public interface InsertService {
    //楼栋添加
    @RequestMapping("building/insert")
    public CommentResult insertBuilding(@RequestBody Building building);

    //住户添加
    @RequestMapping("household/insert")
    public CommentResult insertHousehold(@RequestBody Household household);

    //维修设备信息添加
    @RequestMapping("device/insert")
    public CommentResult insertDevice(@RequestBody Device device);

    //社区公告添加
    @RequestMapping(value = "infobar/insert",consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    public CommentResult insertInfobar(@RequestPart(value = "file",required = false) MultipartFile file,
                                       @RequestParam("info") String info,
                                       @RequestParam("park_id")Integer park_id,
                                       @RequestParam(value = "upload_date",required = false) String upload_date);

    //业主添加
    @RequestMapping("owner/insert")
    public CommentResult insertOwner(@RequestBody Owner owner);

    //添加业主后将对应房间的owner_id改为业主id
    @RequestMapping("room/insertNext")
    public CommentResult insertNext(@PathVariable("id") Integer id);

    //房间添加
    @RequestMapping("room/insert")
    public CommentResult insertRoom(@RequestBody Room room);

    //小区添加
    @RequestMapping("park/insert")
    public CommentResult insertPark(@RequestBody Park park);

    //缴费信息添加
    @RequestMapping("payment/insert")
    public CommentResult insertPayment(@RequestBody Payment payment);
}
